package com.fantasy.dao.impl;

import com.fantasy.dao.BaseDao;
import com.fantasy.dao.StarDao;
import com.fantasy.entity.Star;

public class StarDaoImpl extends BaseDao implements StarDao {
    @Override
    public int insert(Star star) {
        String sql = "insert into `star`(`user_id`,`video_id`)VALUE(?,?)";
        return update(sql,star.getUserId(),star.getVideoId());
    }

    @Override
    public Star queryByUserIdAndVideoId(Integer userId, Integer videoId) {
        String sql = "select * from `star` where `user_id`=? And `video_id`=?";
        return queryForOne(Star.class,sql,userId,videoId);
    }
}
